import { MockjsRequestOptions } from 'mockjs'
import { printReq } from '../common'

export const login = (req: MockjsRequestOptions) => {
    const res = {
      code: 200,
      message: '登陆成功',
      data: {
        data: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhZG1pbl9pZCI6MTQsImV4cCI6MTg3MjQ0MTkyNn0.Q8nQDfeUU0dyNggp3Ditb2u7inyLFAapKxP3qceKKDw'
      }
    }
    return printReq(res,req)
}

export const loginError = (req: MockjsRequestOptions) => {
  const res = {
    code: 404,
    message: '验证失败',
    data: {
      data: ''
    }
  }
  return printReq(res,req)
}